package thss.mro.entity;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * 数据包对象
 */
public class Packet {

//	protected long type;//数据包类型（同协议类型）
	
	protected LinkedHashMap<String,PacketField> fieldChain = new LinkedHashMap<String, PacketField>();//字段链

	public LinkedHashMap<String, PacketField> getFieldChain() {
		return fieldChain;
	}
	
	public void addField(PacketField packFd){
		fieldChain.put(packFd.getTemplateField().getName(), packFd);
	}
	
	public Object getFieldValue(String fieldName){
		return fieldChain.get(fieldName).getValue();
	}
	
	public List<Object> getFieldValueLst(String fieldName){
		return fieldChain.get(fieldName).getValueLst();
	}

//	public void setType(long type) {
//		this.type = type;
//	}
	
}
